<?php
class PapiWS_Model_PersonalizedFaceVO
{
	public $personalizedFaceId;
	public $personalizedProductId;
	public $background;
	public $graphicalObjects = array() ;
	public $faceOrder;
	
	public function __construct( $data = null )
	{
		if( $data ==  null) {
			return;
		}
		
		$this->personalizedFaceId = $data['personalizedFaceId'];
		$this->personalizedProductId = $data['personalizedProductId'];
		$this->faceOrder = $data['faceOrder'];
		foreach( $data['graphicalobjects'] as $go ) {
			switch( $data['graphicalobjects']['type']  ) {
				case 'shape':
					$this->graphicalObjects[] = new ShapeVO( $data['graphicalobjects'] );
					break;
				case 'background':
					$this->graphicalObjects[] = new BackgroundVO( $data['graphicalobjects'] );
					break;
				case 'textBox':
					$this->graphicalObjects[] = new TextBoxVO( $data['graphicalobjects'] );
					break;
			}
		}
		
	}
}
